package 比赛.赛氪.test;


import java.util.Scanner;

public class test5 {
    public static void main(String[] args) {
        int[] a = new int[150];
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            int temp = sc.nextInt();
            a[i] = temp;
            ans += a[i] * a[i - 1];
            a[i] += a[i - 1];
        }
        System.out.println(ans);
    }
}
